package top.zhan.strategy;

/**
 * @author Zhan
 * @date 2022/10/6 10:31
 */
public class DiscountActivity extends Strategy{

    /**
     * 具体的折扣
     */
    private double rate;

    public DiscountActivity(double rate){
        this.rate = rate;
    }

    @Override
    public double computePrice(ProductOrder productOrder) {
        //一系列复杂的计算
        return productOrder.getOldPrice() * rate;
    }
}
